package org.example.test.mapper;

import org.apache.ibatis.annotations.*;
import org.example.test.entity.Record;

import java.util.List;

@Mapper
public interface RecordMapper {
    @Select("select * from test.record where record_new like  '%${recordNew}%'")
    List<Record> findAll(String recordNew);

    @Delete("delete  from test.record where record_id = #{recordId}")
    int delete(Integer recordId);

    @Insert("INSERT into test.record(record_id,record_date,record_old,record_new)values " +
            "(#{recordId},#{recordDate},#{recordOld},#{recordNew})")
    int add(Record record);
    @Update("update test.record set record_id = #{recordId},record_date = #{recordDate},record_old = #{recordOld},record_new = #{recordNew} where record_id=#{recordId}")
    int update(Record record);
}
